package com.rhm.dataStructure.Leetcode;

import java.util.Scanner;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2020/2/23 20:33
 *@Description:
 **/
public class Code35 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){

            String s = sc.nextLine();
            String[]  st = s.split(",");
            int[] arr = new int[st.length];
            for(int i = 0;i<arr.length; i++){
                arr[i] =Integer.parseInt(st[i]);
            }
            int target = sc.nextInt();
            System.out.println(searchInsert(arr,target));
        }
    }
    public static int searchInsert(int[] arr,int target){
        for (int i = 0; i < arr.length; i++) {
            if(target<=arr[i]){
                return i;
            }
        }
        return arr.length;
    }
}
